package com.kgc.xsProvider.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.xs.pojo.SalesOut;
import com.kgc.xs.pojo.SalesOutDetail;
import com.kgc.xs.remote.SalesOutRemote;
import com.kgc.xsProvider.service.SalesOutService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.Map;

@Controller
public class SalesOutController implements SalesOutRemote {

    private Logger logger= LoggerFactory.getLogger(SalesOutController.class);

    @Autowired
    private SalesOutService salesOutService;


    @Override
    public ResponseMsg selectSalesOutByPage(Map<String, Object> map) {
        logger.info("SalesOutController   selectSalesOutByPage params {}",map.toString());
        ResponseMsg responseMsg=salesOutService.selectSalesOutByPage(map);
        logger.debug("SalesOutController   selectSalesOutByPage responseMsg {}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg updateSalesOut(SalesOut salesOut) {
        logger.info("SalesOutController   updateSalesOut params {}",salesOut.toString());
        return null;
    }

    @Override
    public ResponseMsg deleteSalesOut(String docCode) {
        logger.info("SalesOutController   deleteSalesOut params {}",docCode);
        ResponseMsg responseMsg=salesOutService.deleteSalesOut(docCode);
        logger.debug("SalesOutController   deleteSalesOut responseMsg {}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg insertSalesOut(Map<String, Object> map) {
        logger.info("SalesOutController  insertSalesOut params {}",map.toString());
        ResponseMsg responseMsg=salesOutService.insertSalesOut(map);
        logger.debug("SalesOutController  insertSalesOut responseMsg {}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg selectSalesOutDetailByPage(Map<String, Object> map) {
        logger.info("SalesOutController   selectSalesOutDetailByPage params {}",map.toString());
        ResponseMsg responseMsg =salesOutService.selectSalesOutDetail(map.get("docCode").toString());
        logger.debug("SalesOutController   selectSalesOutDetailByPage responseMsg {}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg upDateSalesOutDetail(SalesOutDetail salesOutDetail) {
        return null;
    }

    @Override
    public ResponseMsg insertSalesOutDetail(SalesOutDetail salesOutDetail) {
        return null;
    }

    @Override
    public ResponseMsg deleteSalesOutDetail(Map<String, Object> map) {
        return null;
    }
}
